
#include "widget.h"
#include<QDateTime>
#include<QMediaPlayer>


Widget::Widget(QWidget* parent)
    : QWidget(parent)

{

    setFixedSize(8 * 64, 8 * 64);
    pBox = new BoxGame;
    pMap = new QPainter(this);
}

Widget::~Widget()
{

}
void Widget::yinyue(){
    QMediaPlayer*player =new QMediaPlayer(this);

    connect(player,SIGNAL(positionChanged(qint64)),this,SLOT(positionChanged(qint64)));

}

void Widget::keyPressEvent(QKeyEvent* event)
{
    pBox->keyDown(event);

}

void Widget::paintEvent(QPaintEvent* event)
{
    Q_UNUSED(event);
    pMap->begin(this);
    pBox->drawMap(pMap);
    pBox->bushuqi(pMap);
    pMap->end();
    update();
}


